package com.uenpay.im.ui.old.activity.dynamic;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONObject;

public class PraiseSerializer {
	public static Praise deserializeUser(JSONObject json) {
		Praise praise = new Praise();
		praise.custid = json.optString("custid");
		praise.nickname = json.optString("nickname");
		return praise;
	}

	public static ArrayList<Praise> deserializeUsers(JSONArray json) {
		ArrayList<Praise> Praises = new ArrayList<Praise>();
		for (int i = 0; i < json.length(); i++) {
			JSONObject jsonObject = json.optJSONObject(i);
			if (jsonObject != null) {
				Praises.add(deserializeUser(jsonObject));
			}
		}
		return Praises;
	}
}
